package com.hongsen.cn.fragment;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableInt;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.LinearSnapHelper;
import androidx.recyclerview.widget.RecyclerView;

import com.hcnetsdk.jna.HCNetSDKByJNA;
import com.hcnetsdk.jna.HCNetSDKJNAInstance;
import com.hikvision.netsdk.HCNetSDK;
import com.hongsen.cn.Utils.GsonUtils;
import com.hongsen.cn.Utils.LogUtil;
import com.hongsen.cn.Utils.NumberUtils;
import com.hongsen.cn.Utils.RxBus;
import com.hongsen.cn.Utils.SPUtil;
import com.hongsen.cn.activity.RefreshFaceForWorkActivity;
import com.hongsen.cn.activity.SearchPresonActivity;
import com.hongsen.cn.activity.WorkDescActivity;
import com.hongsen.cn.adapter.NativeAdapter;
import com.hongsen.cn.adapter.PoliceImgAdapter;
import com.hongsen.cn.adapter.WorkScheduleAdapter;
import com.hongsen.cn.application.DayAndMonthApplication;
import com.hongsen.cn.base.BaseFragment;
import com.hongsen.cn.bean.BaseTitleBean;
import com.hongsen.cn.bean.FirstPageFaceCallBackBean;
import com.hongsen.cn.bean.HaveNotDoneWorkBean;
import com.hongsen.cn.bean.NativeBean;
import com.hongsen.cn.bean.OrderBean;
import com.hongsen.cn.bean.PoliceBean;
import com.hongsen.cn.bean.RxValue;
import com.hongsen.cn.bean.WorkPlanBean;
import com.hongsen.cn.bean.WorkPlanFBean;
import com.hongsen.cn.contract.HomeView;
import com.hongsen.cn.dayandmonth.R;
import com.hongsen.cn.dayandmonth.databinding.FragmentHomeBinding;
import com.hongsen.cn.presenter.HomePresenter;
import com.sun.jna.Pointer;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;

import static com.hongsen.cn.bean.RxBusEventKey.REFRESH_INTENT;
import static com.hongsen.cn.bean.RxBusEventKey.iHANDLE_CODE_ONE;

/**
 * 首页fragment
 * 跳转
 * 更多
 * 个人查询
 * 所内通知详情
 * 警员点击详情
 * 未处理事项详情
 */
public class HomeFragment extends BaseFragment<HomePresenter> implements HomeView, View.OnClickListener {

    public FragmentHomeBinding binding;
    public ObservableInt FBI_ROLE_DOCTOR = new ObservableInt(View.VISIBLE);
    public ObservableInt FBI_ROLE_POLICE = new ObservableInt(View.VISIBLE);
    public ObservableInt FBI_ROLE_LEADER = new ObservableInt(View.VISIBLE);
    public ObservableInt FBI_ROLE_OFFER = new ObservableInt(View.VISIBLE);

    public List<NativeBean.RecordsBean> list = new ArrayList<>();
    public LinearLayoutManager linearLayoutManager;
    public NativeAdapter nativeAdapter;

    public List<FirstPageFaceCallBackBean.RecordsBean> listImgs = new ArrayList<>();
    public GridLayoutManager gridLayoutManager;
    public PoliceImgAdapter policeImgAdapter;

    public List<WorkPlanFBean> listWorks = new ArrayList<>();
    public WorkPlanFBean fBean ;
    public LinearLayoutManager llModuleWorkManager;
    public WorkScheduleAdapter workScheduleAdapter;

    private int m_ALoginID = -1;
    private int m_BLoginID = -1;

    private int Statue = 0;//0进门 2出门

    private final HCNetSDKByJNA.FMSGCallBack fMSFCallBack = new FMSGCallBack();


    public HomeFragment() {

    }

    @Override
    protected HomePresenter createPresenter() {
        return new HomePresenter(this);
    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_home;
    }

    @Override
    protected void initToolbar(Bundle savedInstanceState) {

    }

    @Override
    protected void initData() {

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        binding = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_home, null, false);
        binding.setFragment(this);
        initView();
        presenter = new HomePresenter(this);
        return binding.getRoot();
    }

    @SuppressLint("CheckResult")
    private void initView() {
        if (initSdk()) {
            loginDevice();
            setupAlarm();
        }


        // 使用线程池
        es = Executors.newSingleThreadExecutor();
        es.execute(new Runnable() {
            @Override
            public void run() {
                while (isTrue) {
                    if (System.currentTimeMillis() - tTime > 5000) {
                        Message msg = Message.obtain();
                        msg.what = iHANDLE_CODE_ONE;
                        msg.obj = "";
                        handler.sendMessage(msg);
                        tTime = System.currentTimeMillis();
                    }
                }
            }
        });

        presenter = new HomePresenter(this);
        presenter.getFirstPageFceList();

        RxBus.getDefault()
                .toObservable(RxValue.class)
                .observeOn(AndroidSchedulers.mainThread()).
                subscribe(new Consumer<RxValue>() {
                    @Override
                    public void accept(RxValue rxValue) throws Exception {
                        if (rxValue.getKey().equals(REFRESH_INTENT)) {
                            presenter.getHaveNotDoneWork();
                        }
                    }
                });


        list.clear();
        linearLayoutManager = new LinearLayoutManager(getActivity(), RecyclerView.HORIZONTAL, false);
        binding.recyclerView.setLayoutManager(linearLayoutManager);
        LinearSnapHelper linearSnapHelper = new LinearSnapHelper();
        linearSnapHelper.attachToRecyclerView(binding.recyclerView);
        nativeAdapter = new NativeAdapter(getActivity(), list);
        binding.recyclerView.setAdapter(nativeAdapter);

        listImgs.clear();
        gridLayoutManager = new GridLayoutManager(getActivity(), 2);
        binding.recyclerViewFace.setLayoutManager(gridLayoutManager);
        policeImgAdapter = new PoliceImgAdapter(getActivity(), listImgs);
        binding.recyclerViewFace.setAdapter(policeImgAdapter);

        listWorks.clear();
        llModuleWorkManager = new LinearLayoutManager(getActivity());
        llModuleWorkManager.setOrientation(RecyclerView.HORIZONTAL);
        LinearSnapHelper linearSnapHelperSecong = new LinearSnapHelper();
        linearSnapHelperSecong.attachToRecyclerView(binding.recyclerViewWork);
        binding.recyclerViewWork.setLayoutManager(llModuleWorkManager);
        workScheduleAdapter = new WorkScheduleAdapter(getActivity(), listWorks);
        binding.recyclerViewWork.setAdapter(workScheduleAdapter);

        //医生
        binding.tvDoctorOrder.setOnClickListener(this);
        //民警
        binding.tvPoliceOrder.setOnClickListener(this);
        binding.tvTalk.setOnClickListener(this);
        binding.tvWGTJ.setOnClickListener(this);
        binding.tvLocation.setOnClickListener(this);
        //所领导
        binding.tvLeaderOrder.setOnClickListener(this);
        binding.tvLeaderApprove.setOnClickListener(this);
        //检察官
        binding.tvJCGOrder.setOnClickListener(this);

        binding.tvFaceMore.setOnClickListener(this);
        binding.btnSearch.setOnClickListener(this);

    }

    //初始化sdk
    private boolean initSdk() {
        // init net sdk
        if (!HCNetSDK.getInstance().NET_DVR_Init()) {
            LogUtil.e("海康SDK加载失败");
            return false;
        }
        HCNetSDK.getInstance().NET_DVR_SetConnectTime(2000);
        HCNetSDK.getInstance().NET_DVR_SetReconnect(10000, true);
        return true;
    }


    private void loginDevice() {
        HCNetSDKByJNA.NET_DVR_USER_LOGIN_INFO loginInfo = new HCNetSDKByJNA.NET_DVR_USER_LOGIN_INFO();
        loginInfo.wPort = (short) 8000;
        HCNetSDKByJNA.NET_DVR_DEVICEINFO_V40 deviceInfo = new HCNetSDKByJNA.NET_DVR_DEVICEINFO_V40();
        loginInfo.write();
        m_ALoginID = HCNetSDKJNAInstance.getInstance().NET_DVR_Login_V40(loginInfo.getPointer(), deviceInfo.getPointer());
        if (m_ALoginID < 0) {
            LogUtil.e("A门摄像头登录失败:" + HCNetSDKJNAInstance.getInstance().NET_DVR_GetLastError());
        } else {
            deviceInfo.read();
            LogUtil.e("A门摄像头登录成功.");
        }

        loginInfo.wPort = (short) 8000;
        HCNetSDKByJNA.NET_DVR_DEVICEINFO_V40 deviceInfoB = new HCNetSDKByJNA.NET_DVR_DEVICEINFO_V40();
        loginInfo.write();
        m_BLoginID = HCNetSDKJNAInstance.getInstance().NET_DVR_Login_V40(loginInfo.getPointer(), deviceInfoB.getPointer());
        if (m_BLoginID < 0) {
            LogUtil.e("B门摄像头登录失败:" + HCNetSDKJNAInstance.getInstance().NET_DVR_GetLastError());
        } else {
            deviceInfoB.read();
            LogUtil.e("B门摄像头登录成功.");
        }
    }


    private void setupAlarm() {
        Pointer pUser = null;
        if (!HCNetSDKJNAInstance.getInstance().NET_DVR_SetDVRMessageCallBack_V30(fMSFCallBack, pUser)) {
            LogUtil.e("NET_DVR_SetDVRMessageCallBack_V30 failed:" + HCNetSDKJNAInstance.getInstance().NET_DVR_GetLastError());
        }
        HCNetSDKByJNA.NET_DVR_SETUPALARM_PARAM m_strAlarmInfo = new HCNetSDKByJNA.NET_DVR_SETUPALARM_PARAM();
        m_strAlarmInfo.dwSize = m_strAlarmInfo.size();
        m_strAlarmInfo.byFaceAlarmDetection = 0;
        m_strAlarmInfo.byDeployType = 1;//布防类型：0-客户端布防，1-实时布防
        int iAlarmHandle = HCNetSDKJNAInstance.getInstance().NET_DVR_SetupAlarmChan_V41(m_ALoginID, m_strAlarmInfo);
        if (-1 == iAlarmHandle) {
            LogUtil.e("A门摄像头布防失败,失败原因：" + HCNetSDK.getInstance().NET_DVR_GetLastError());
        } else {
            LogUtil.e("A门摄像头布防成功");
        }
        iAlarmHandle = HCNetSDKJNAInstance.getInstance().NET_DVR_SetupAlarmChan_V41(m_BLoginID, m_strAlarmInfo);
        if (-1 == iAlarmHandle) {
            LogUtil.e("B门摄像头布防失败,失败原因：" + HCNetSDK.getInstance().NET_DVR_GetLastError());
        } else {
            LogUtil.e("B门摄像头布防成功");
        }
    }

    //海康相机报警回调
    public class FMSGCallBack implements HCNetSDKByJNA.FMSGCallBack {
        @Override
        public void invoke(int lCommand, HCNetSDKByJNA.NET_DVR_ALARMER pAlarmer,
                           Pointer pAlarmInfo, int dwBufLen, Pointer pUser) {
            //人脸检测服务
            //            if (lCommand == HCNetSDKByJNA.COMM_SNAP_MATCH_ALARM) {
            HCNetSDKByJNA.NET_VCA_FACESNAP_MATCH_ALARM strFaceSnapMatch = new HCNetSDKByJNA.NET_VCA_FACESNAP_MATCH_ALARM();
            strFaceSnapMatch.write();
            Pointer pFaceSnapMatch = strFaceSnapMatch.getPointer();
            pFaceSnapMatch.write(0, pAlarmInfo.getByteArray(0, strFaceSnapMatch.size()), 0, strFaceSnapMatch.size());
            strFaceSnapMatch.read();
            try {
                String alarmIp = new String(pAlarmer.sDeviceIP, "GBK").trim();

                if (alarmIp.equals(DayAndMonthApplication.getInstance().getConfig().getaCameraIP())) {
                    Statue = 0;
                    LogUtil.e("摄像头A（进门）");
                } else {
                    Statue = 1;
                    LogUtil.e("摄像头B (出门）");
                }

                if (strFaceSnapMatch.fSimilarity >= DayAndMonthApplication.getInstance().getConfig().getSimilarity()) {
                    String policeNum = new String(strFaceSnapMatch.struBlackListInfo.struBlackListInfo.struAttribute.byCertificateNumber, "GBK").trim();
                    LogUtil.e("人脸抓拍比对报警, 相似度: " + strFaceSnapMatch.fSimilarity + ", 警号 :" + policeNum);
                    LogUtil.e("人脸抓拍alarmIp-->" + alarmIp);
                    LogUtil.e("人脸抓拍policeNum-->" + policeNum);
                    presenter.login(policeNum);
                } else {
                    LogUtil.e("人脸抓拍比对报警, 相似度: " + strFaceSnapMatch.fSimilarity + ", 相似度小于阈值-->0.5");
                }
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
            //            }
        }
    }


    @Override
    public void onClick(View v) {
        int sS_ID = v.getId();
        if (sS_ID == R.id.tvDoctorOrder) {
            presenter.getOrderList("预约", "0", "");
        } else if (sS_ID == R.id.tvPoliceOrder) {
            presenter.getOrderList("预约", "1", "");
        } else if (sS_ID == R.id.tvLeaderOrder) {
            presenter.getOrderList("预约", "2", "");
        } else if (sS_ID == R.id.tvJCGOrder) {
            presenter.getOrderList("预约", "4", "");
        } else if (sS_ID == R.id.tvTalk) {
            presenter.getOrderList("谈话", "1", "");
        } else if (sS_ID == R.id.tvLeaderApprove) {
            presenter.getOrderList("审批", "2", "");
        } else if (sS_ID == R.id.tvWGTJ) {
            presenter.getOrderList("违规", "1", "");
        } else if (sS_ID == R.id.tvLocation) {
            presenter.getOrderList("定位警情", "1", "");
        } else if (sS_ID == R.id.tvFaceMore) {
            startActivity(new Intent(getActivity(), RefreshFaceForWorkActivity.class));
        } else if (sS_ID == R.id.btnSearch) {
            startActivity(new Intent(getActivity(), SearchPresonActivity.class));
        }
    }


    @Override
    public void onHiddenChanged(boolean hidden) {
        super.onHiddenChanged(hidden);
        if (!hidden) {

        }
    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
    }


    //预约，谈话，违规,定位警情,加戴械具,监室耳目
    @Override
    public void getOrderList(String type, String bodyId, List<OrderBean> str) {

        Intent intent = new Intent(getActivity(), WorkDescActivity.class);
        switch (bodyId) {
            case "0":
                if (type.equals("预约")) {
                    intent.putExtra("module_type", "预约");
                    intent.putExtra("module_listBean", (Serializable) str);
                    startActivity(intent);
                }
                break;
            case "1":
                if (type.equals("预约")) {
                    intent.putExtra("module_type", "预约");
                    intent.putExtra("module_listBean", (Serializable) str);
                    startActivity(intent);
                } else if (type.equals("谈话")) {
                    intent.putExtra("module_type", "谈话");
                    intent.putExtra("module_listBean", (Serializable) str);
                    startActivity(intent);
                } else if (type.equals("违规")) {
                    intent.putExtra("module_type", "违规");
                    intent.putExtra("module_listBean", (Serializable) str);
                    startActivity(intent);
                } else if (type.equals("定位警情")) {
                    intent.putExtra("module_type", "定位警情");
                    intent.putExtra("module_listBean", (Serializable) str);
                    startActivity(intent);
                }
                break;
            case "2":
                if (type.equals("预约")) {
                    intent.putExtra("module_type", "预约");
                    intent.putExtra("module_listBean", (Serializable) str);
                    startActivity(intent);
                } else if (type.equals("审批")) {
                    intent.putExtra("module_type", "审批");
                    intent.putExtra("module_listBean", (Serializable) str);
                    startActivity(intent);
                }
                break;
            case "4":
                if (type.equals("预约")) {
                    LogUtil.e("检察官");
                    intent.putExtra("module_type", "预约");
                    intent.putExtra("module_listBean", (Serializable) str);
                    startActivity(intent);
                }
                break;
            default:
        }
    }

    public ExecutorService es;
    public boolean isTrue = true;
    public long tTime = 0;
    public int listIndex = 0;
    public int workPlanIndex = 0;

    @Override
    public void getNotiveList(List<NativeBean.RecordsBean> listBeans) {
        list.clear();
        list.addAll(listBeans);
        nativeAdapter.notifyDataSetChanged();


    }

    @SuppressLint("HandlerLeak")
    public Handler handler = new Handler() {
        @Override
        public void handleMessage(@NonNull Message msg) {

            if (list.size() > 1) {
                if (listIndex < list.size()) {
                    binding.recyclerView.smoothScrollToPosition(listIndex++);
                    binding.tvModulePageAndCount.setText(listIndex + "/" + list.size());
                } else {
                    listIndex = 0;
                    linearLayoutManager.scrollToPositionWithOffset(listIndex++, 0);
                    binding.tvModulePageAndCount.setText(listIndex + "/" + list.size());
                }
            }else{
                binding.tvModulePageAndCount.setText(1 + "/" + list.size());
            }


            if (listWorks.size() > 1) {
                if (workPlanIndex < listWorks.size()){
                    binding.recyclerViewWork.smoothScrollToPosition(workPlanIndex++);
                }else{
                    workPlanIndex = 0;
                    llModuleWorkManager.scrollToPositionWithOffset(workPlanIndex++,0);
                }
            }

        }
    };

    @Override
    public void onDestroy() {
        super.onDestroy();
        isTrue = false;

    }

    public void getFirstPageFceList(FirstPageFaceCallBackBean bean) {
        LogUtil.e("首页签到民警列表-->" + bean.getRecords().size() + "个");
        listImgs.clear();
        for (int i = 0; i < 6; i++) {
            listImgs.add(bean.getRecords().get(i));
        }
        policeImgAdapter.notifyDataSetChanged();
    }

    @Override
    public void getLogiInfo(PoliceBean s) {
        LogUtil.e("人脸识别成功-->" + GsonUtils.getInstance().toJson(s));

        if (NumberUtils.isCurrentInTimeScope(6, 0, 12, 0)) {
            if (Statue == 0) {
                presenter.saveFaceInfo("10", s.getJh() + "00");
            }
        } else if (NumberUtils.isCurrentInTimeScope(11, 25, 12, 0)) {
            if (Statue == 1) {
                presenter.saveFaceInfo("20", s.getJh() + "00");
            }
        } else if (NumberUtils.isCurrentInTimeScope(12, 0, 18, 0)) {
            if (Statue == 0) {
                presenter.saveFaceInfo("30", s.getJh() + "00");
            }
        } else if (NumberUtils.isCurrentInTimeScope(16, 30, 18, 0)) {
            if (Statue == 1) {
                presenter.saveFaceInfo("40", s.getJh() + "00");
            }
        }

    }

    /**
     * MEDICALTREATMENT 医疗
     * CONTROL 管教
     * LEDBY 所领导
     * PROCURATOR 检察官
     */
    @Override
    public void getHaveNotDoneWork(HaveNotDoneWorkBean bean) {
        try {
            if (bean.getDoctor() != null) {
                binding.tvDoctorOrder.setText("预约(" + bean.getDoctor().getCount() + ")");
            }
        } catch (Exception e) {
            LogUtil.e("医生接口异常");
        }

        try {
            for (HaveNotDoneWorkBean.ControlBean controlBean : bean.getControl()) {
                if (controlBean.getType().equals("预约")) {
                    binding.tvPoliceOrder.setText("预约(" + controlBean.getCount() + "）");
                } else if (controlBean.getType().equals("违规")) {
                    binding.tvWGTJ.setText("违规(" + controlBean.getCount() + ")");
                } else if (controlBean.getType().equals("谈话")) {
                    binding.tvTalk.setText("谈话(" + controlBean.getCount() + ")");
                } else if (controlBean.getType().equals("定位警情")) {
                    binding.tvLocation.setText("定位警情(" + controlBean.getCount() + ")");
                }
            }
        } catch (Exception e) {
            LogUtil.e("管教接口异常");
        }

        try {
            if (bean.getLedby().getType().equals("预约")) {
                binding.tvLeaderOrder.setText("预约(" + bean.getLedby().getCount() + "）");
            }
        } catch (Exception e) {
            LogUtil.e("所领导接口异常");
        }

        try {
            binding.tvJCGOrder.setText("预约(" + bean.getProcurator().getCount() + ")");
        } catch (Exception e) {
            LogUtil.e("检察官接口异常");
        }

        presenter.getWorkPlan();

    }

    public int index = 0;
    public List<WorkPlanBean> listWorkSeconds = new ArrayList<>();
    public void getWorkPlan(List<WorkPlanBean> bean) {
        index = 0;
        listWorks.clear();
        listWorkSeconds.clear();
        for(WorkPlanBean workPlanBean : bean){
            if(index < 4){
                listWorkSeconds.add(workPlanBean);
                index++;
            }else if (index == 4){
                index = 0;
                fBean = new WorkPlanFBean();
                fBean.setWorkOne(listWorkSeconds.get(0));
                fBean.setWorkTwo(listWorkSeconds.get(1));
                fBean.setWorkThree(listWorkSeconds.get(2));
                fBean.setWorkFour(listWorkSeconds.get(3));
                LogUtil.e("添加民警-->"+ workPlanBean.getMjxm() + " index-->" + index);
                fBean.setWorkFive(workPlanBean);
                listWorks.add(fBean);
                listWorkSeconds.clear();
                workScheduleAdapter.notifyDataSetChanged();
            }
        }

        if (listWorkSeconds.size() != 0) {
            fBean = new WorkPlanFBean();
            switch (listWorkSeconds.size()){
                case 1 :
                    fBean.setWorkOne(listWorkSeconds.get(0));
                    break;
                case 2:
                    fBean.setWorkOne(listWorkSeconds.get(0));
                    fBean.setWorkTwo(listWorkSeconds.get(1));
                    break;
                case 3:
                    fBean.setWorkOne(listWorkSeconds.get(0));
                    fBean.setWorkTwo(listWorkSeconds.get(1));
                    fBean.setWorkThree(listWorkSeconds.get(2));
                    break;
                case 4:
                    fBean.setWorkOne(listWorkSeconds.get(0));
                    fBean.setWorkTwo(listWorkSeconds.get(1));
                    fBean.setWorkThree(listWorkSeconds.get(2));
                    fBean.setWorkFour(listWorkSeconds.get(3));
                    break;
                case 5:
                    fBean.setWorkOne(listWorkSeconds.get(0));
                    fBean.setWorkTwo(listWorkSeconds.get(1));
                    fBean.setWorkThree(listWorkSeconds.get(2));
                    fBean.setWorkFour(listWorkSeconds.get(3));
                    fBean.setWorkFive(listWorkSeconds.get(4));
                    break;
                    default:
            }
            listWorks.add(fBean);
            listWorkSeconds.clear();
            workScheduleAdapter.notifyDataSetChanged();
        }

        presenter.getTitleInfo();
    }

    @Override
    public void saveFaceInfo(String s) {
        presenter.getFirstPageFceList();
    }

    @Override
    public void getTitleInfo(BaseTitleBean str) {
        if (str != null) {
            RxBus.getDefault().post(new RxValue("module_FBI_WG", String.valueOf(str.getEffectiveVO().getNissinMonthlyCount())));
            RxBus.getDefault().post(new RxValue("module_FBI_JD", String.valueOf(str.getMechanicalDeviceVo().getNissinMonthlyCount())));
            RxBus.getDefault().post(new RxValue("module_FBI_JD_CC", String.valueOf(str.getMechanicalDeviceVo().getArePersonnelCount())));
            RxBus.getDefault().post(new RxValue("module_FBI_DT", String.valueOf(str.getRiskVO().getNissinMonthlyCount())));
            RxBus.getDefault().post(new RxValue("module_FBI_CS", String.valueOf(str.getOutVO().getNissinMonthlyCount())));

            SPUtil.putString("module_title_wg",String.valueOf(str.getEffectiveVO().getNissinMonthlyCount()));
            SPUtil.putString("module_title_jd",String.valueOf(str.getMechanicalDeviceVo().getNissinMonthlyCount()));
            SPUtil.putString("module_title_jd_cc",String.valueOf(str.getMechanicalDeviceVo().getArePersonnelCount()));
            SPUtil.putString("module_title_dt",String.valueOf(str.getRiskVO().getNissinMonthlyCount()));
            SPUtil.putString("module_title_cs",String.valueOf(str.getOutVO().getNissinMonthlyCount()));
        }

        presenter.getNotiveList(1, 3);
    }
}
